<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
	content="text/html; charset=<?php echo $this->config->item('charset');?>">
	<title>账号管理</title>
	<link href="<?php echo base_url();?>public/css/base.css"
		rel="stylesheet" type='text/css'>
		<script language='javascript'>
            function Sel(stype)
            {
                for(var i=0;i < document.getElementsByName('aids').length;i++)
                {
                    if(stype=='all') document.getElementsByName('aids')[i].checked=true;
                    else document.getElementsByName('aids')[i].checked=false;
                }
            }
            function checkSubmit()
            {
				if(!confirm('是否将此数据删除?'))
				{
					 return false;
				}
                var str = '';
                for(var i=0;i < document.getElementsByName('aids').length;i++)
                {
                    if(document.getElementsByName('aids')[i].checked){
                        if(str=='') str += document.getElementsByName('aids')[i].value;
                        else str += ',' + document.getElementsByName('aids')[i].value;
                    }
                }
                if(str=='')
                    {
                    alert('你没选择任何内容！');
                    return false;
                }
                else
                    {
                    location="<?php echo site_url("admin/system/account_del?aids="); ?>"+str;
                }
            }
        </script>

</head>
<body background='<?php echo base_url();?>public/images/allbg.gif'
	leftmargin='8' topmargin='8'>

	<table width="98%" border="0" align="center" cellpadding="3"
		cellspacing="1" bgcolor="#D6D6D6">
		<tr>
			<td height="28"
				background="<?php echo base_url();?>public/images/tbg.gif"
				colspan="8" style="padding-left: 10px;">
				<div style="float: left">
					<b>账号管理</b>
				</div>
				<div style="float: right; padding-right: 6px;">
					[<a href="<?php echo site_url("admin/system/account_add")?>"><u>添加账号</u></a>]

				</div>
			</td>
		</tr>
		<tr>
			<td height="30" align="center" bgcolor="#F9FCEF" colspan="8"></td>
		</tr>
		<form name='form1' method='post' action=''
			onSubmit='return checkSubmit();'>
			<input type='hidden' name='dopost' value='delall' /> <input
				type='hidden' name='allid' value='' />
			<tr align="center" bgcolor="#FBFCE2" height="26">
				<td width="6%">选择</td>
				<td width="15%">用户名</td>
				<td width="12%">类型</td>
				<td width="10%">真实姓名</td>
				<td width="12%">电话</td>
				<td width="16%">邮箱</td>
				<td width="14%">时间</td>
				<td width="17%">管理</td>
			</tr>


                <?php
																if ($list->num_rows () > 0) {
																	foreach ( $list->result () as $row ) {
																		?>
                        <tr align="center" bgcolor="#FFFFFF" height="26"
				onMouseMove="javascript:this.bgColor='#FCFDEE';"
				onMouseOut="javascript:this.bgColor='#FFFFFF';">
				<td><input type='checkbox' name='aids' value='<?php echo $row->id?>'
					class='np'></td>
				<td><?php echo $row->userid;?></td>
				<td>
                                  <?php 
                                  		if($row->usertype=='1')
                                  		{
                                  			echo '内部用户';
                                  		}else
                                  		{
                                  			echo '管理员';
                                  		}
                                  
                                  ?>
                                </td>
				<td><?php echo $row->uname;?></td>

				<td><?php echo $row->tel;?></td>
				<td><?php echo $row->email;?></td>
				<td><?php echo $row->logintime;?></td>
				<td>
				<?php 
				if($row->usertype=='1')
                   {
				   ?>
						<a href='<?php echo site_url("admin/system/account_modify?id=$row->id"); ?>'>[更改]</a>
						<a href='<?php echo site_url("admin/system/account_del?aids=$row->id"); ?>'
						onclick="return confirm('是否将此数据删除?')">[删除]</a>
				<?php 	}
					
					?>
					<a href='<?php echo site_url("admin/system/resetpwd?id=$row->id"); ?>'>[重置密码]</a>
					</td>
			</tr>

                        <?php
																	}
																}
																?>








            </form>
		<tr bgcolor="#ffffff" height="28">
			<td colspan="8"><a href='#' onclick='Sel("all")' class='np coolbg'>[全选]</a>
				<a href='#' onclick='Sel("none")' class='np coolbg'>[取消]</a> <a
				href='#' onclick='checkSubmit()' class='np coolbg'>批量删除</a></td>
		</tr>
		<tr align="center" bgcolor="#F9FCEF" height="28">
			<td colspan="8">
                    <?php echo $page?>
                </td>
		</tr>
	</table>
	</td>
	</tr>
	</table>
</body>
</html>